

public class CreateSortVector {


	public static void main(String[] args) {

	}

	public static int[] getVct(int size) {
		
		int[] v = randVector(size);
		quickSort(v, 0, v.length);
		
		return v;
	}

	public static void printVector(int[] iVector) {
		for (int i = 0; i < iVector.length; i++) {
			System.out.print(iVector[i] + ",");
		}
	}

	public static void quickSort(int v[], int ini, int fim) {
		int posPivo;

		if (ini < fim) {

			int valorPivo;
			valorPivo = v[ini];
			posPivo = ini;

			for (int i = ini + 1; i < fim; i++) {

				if (v[i] < valorPivo) {

					v[posPivo] = v[i];
					posPivo++;
					v[i] = v[posPivo];
					v[posPivo] = valorPivo;

				}
			}
			quickSort(v, ini, posPivo);
			quickSort(v, posPivo + 1, fim);
		}
	}

	public static int[] randVector(int vectSize) {
		int[] vect = new int[vectSize];

		for (int i = 0; i < vectSize; i++) {

			vect[i] = (int) (Math.random() * 100);

		}
		return vect;
	}
}